<template>
    <div class="common_br">
        <h2 class="common_channel_title">指标信息</h2>
        <div class="common_content">
            <Form :model="modalData" :label-width="100" disabled>
                <Row>
                    <Col span="8">
                        <FormItem label="名称" prop="elementName">
                            <Input :value="getValue(modalData.elementName,dataDict.channelGradeElementDict)" placeholder />
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="权重(%)" prop="elementWeight" style="w200">
                            <Input v-model="modalData.elementWeight" placeholder />
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="指标种类" prop="elementEditType">
                            <Select v-model="modalData.elementEditType" placeholder>
                                <Option v-for="(item,index) in dataDict.gradeModelElementTypeDict" :key="index" :value="item.value">{{item.title}}</Option>
                            </Select>
                        </FormItem>
                    </Col>
                </Row>
            </Form>
        </div>
    </div>
</template>

<script>
export default {
    // 指标信息
    name: "IndicatorInfo",
    props: {
        modalData: {
            type: Object,
            required: true
        },
        dataDict: {
            type: Object
        },
    },
    methods: {
        getValue(value, dict) {
            if (!value || !dict) return;
            for (let i = 0; i < dict.length; i++) {
                if (value === dict[i].value)
                    return dict[i].title
            }
            return '';
        },
    }
}
</script>

<style>
</style>
